<script setup lang="ts">
import MainAside from '@/components/main-aside/main-aside.vue'
import MainHeader from '@/components/main-header/main-header.vue'
import { ref } from 'vue'
// 处理mainheader面包屑
const isCollapse = ref(false)
const foldHandleChange = (isFoldValue: boolean) => {
  isCollapse.value = isFoldValue
}
</script>
<template>
  <div class="main">
    <el-container class="main-container">
      <el-aside :width="isCollapse ? '60px' : '210px'" class="main-aside">
        <main-aside :is-collapse="isCollapse"></main-aside>
      </el-aside>
      <el-container>
        <el-header class="main-header" height="50px">
          <main-header @fold-change="foldHandleChange"></main-header>
        </el-header>
        <el-main class="main-main">
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<style scoped lang="less">
.main {
  height: 100%;
  .main-container {
    height: 100%;
    .main-aside {
      background-color: var(--primary-bg-color);
      overflow-y: auto;
      overflow-x: hidden;
      cursor: pointer;
      line-height: 200px;
      text-align: left;
      transition: width 0.3s linear;
      scrollbar-width: none;
      -ms-overflow-style: none;
      &::-webkit-scrollbar {
        display: none;
      }
    }
    .main-header {
      background-color: #ffffff;
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
    }
    .main-main {
      background-color: #f0f2f5;
    }
  }
}
</style>
